import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;


public class About extends JFrame
{
	private String type;
	private JFrame frame;
	private JPanel backPanel;
	private Controller control;
	
	public About(Controller myControl, String myType)
	{
		type=myType;
		frame=new JFrame();
		backPanel=new JPanel();
		frame.add(backPanel);
		control=myControl;
		backPanel.setLayout(new BoxLayout(backPanel, BoxLayout.Y_AXIS));
		backPanel.setAlignmentX(LEFT_ALIGNMENT);
		setUpBackPanel();
		frame.setVisible(true);
		frame.pack();
		
		
		//AnimationControl animate=new AnimationControl(control);
		//frame.add(animate.getBackPanel());
	}
	
	public void setUpBackPanel()
	{
		if (type.equals("Searching"))
		{
			
		}
		else
		{
			JButton goAnimate=new JButton("See sorting methods in action!");
			goAnimate.addActionListener(new ActionListener()
			{

				@Override
				public void actionPerformed(ActionEvent e) {
					// TODO Auto-generated method stub
					AnimationControl animate=new AnimationControl(control);
					backPanel.add(animate.getBackPanel());
				}
				
			});
			backPanel.add(goAnimate);
		}
		repaint();
		frame.pack();
	}
}
